package com.nt.train.annotation;
import java.lang.annotation.*;
import org.springframework.context.annotation.Scope;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;

/**
 * @author hlf
 * @version 1.0
 * @date 2022/8/10 11:05
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
//标注bean为单例bean
@Scope("singleton")
@Component
public @interface SingletonComponent {

    //让这里的value值对应到Component中的value值，可以定义bean名称
    @AliasFor(annotation = Component.class, attribute = "value")
    String value() default "";
}
